void OpenFileIntoBuffer()                               
{                                                 
	FILE *pfile = fopen("test.txt","r");      
	if(pfile == NULL)                         
		cout<<"open file error"<<endl;    
	                                          
	long nLength=0;                           
	fseek(pfile,0,SEEK_END);                  
	nLength = ftell(pfile);                   
	fseek(pfile,0,SEEK_SET);                  
	char* pBuffer = new char[nLength+1];      
	fread(pBuffer,sizeof(char),nLength,pfile);
	pBuffer[nLength]='\0';                    

//do things with this buffer

	cout<<pBuffer<<endl;                      
	delete []pBuffer;                         
	fclose(pfile);
}                                                 